package com.gaming.glb;

import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.sprite.BaseSprite;
import org.anddev.andengine.opengl.texture.region.BaseTextureRegion;
import com.badlogic.gdx.physics.box2d.Body;

public abstract class BaseEntity {


	//protected PhysicsWorld physicsWorld;
    protected BaseTextureRegion baseTextureRegion;

    //calculated properties
    protected float width;
    protected float height;
	
    protected BaseSprite newEntity;

	//physical properties
    protected boolean havePhysicsConnector;
    protected Body newBody;  
    
    protected PhysicBall mBall;
    
    public BaseEntity() {}
    
    public abstract void attachToScene(Scene scene);
    
	public void setPosition(final float posX, final float posY) {
		
		if (!this.havePhysicsConnector) {
			this.newEntity.setPosition(posX - (this.width/2), posY - (this.height/2));
		}
	}
	
	public float getPositionX()	{
		return this.newEntity.getX();
	}
	
	public float getPositionY()	{
		return this.newEntity.getY();
	}
	
	public Body getBody(){
		return this.newBody;
	}

	public BaseSprite getSprite(){
		return newEntity;
	}	
}
